﻿using System;
using System.Collections.Generic;
using Microsoft.TeamFoundation.Client;

namespace VisualWip.TFS2010Providers
{
    public class LastProjectSelector : ITeamProjectPickerDefaultSelectionProvider
    {
        static readonly LastProjectSelector StaticInstance = new LastProjectSelector();

        static LastProjectSelector()
        {
        }

        LastProjectSelector()
        {
        }

        public static LastProjectSelector Instance
        {
            get
            {
                return StaticInstance;
            }
        }


        public Uri LastServerUri { get; set; }
        public Guid? LastCollectionId { get; set; }
        public string LastProjectId { get; set; }


        #region ITeamProjectPickerDefaultSelectionProvider Members

        public Uri GetDefaultServerUri()
        {
            return LastServerUri;
        }

        public Guid? GetDefaultCollectionId(Uri instanceUri)
        {
            return LastCollectionId;
        }

        public IEnumerable<string> GetDefaultProjects(Guid collectionId)
        {
            return new List<string> {LastProjectId};
        }

        #endregion
    }
}